package com.yunkaweilai.android.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;

import com.yunkaweilai.android.R;
import com.yunkaweilai.android.interfaces.GoodsZeroInterfaces;
import com.yunkaweilai.android.interfaces.SimpleInterface;
import com.yunkaweilai.android.model.shop.SearchShopModel;
import com.yunkaweilai.android.model.shop.ShopModel;
import com.yunkaweilai.android.model.shop.ShopSkuInfoModel;

/**
 * Created by Administrator on 2018/7/4.
 */

public class GoodsStockZeroDialog2 extends Dialog {

    private SimpleInterface simpleInterface;
    private SearchShopModel.DataBean.GoodsListBean item;
    public GoodsStockZeroDialog2(@NonNull Context context, SimpleInterface simpleInterface,SearchShopModel.DataBean.GoodsListBean item) {
        super(context, R.style.dialog);
        this.simpleInterface = simpleInterface;
        this.item = item;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_goods_zero);
        findViewById(R.id.id_tv_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        findViewById(R.id.id_tv_right).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                item.setBuy_num(item.getBuy_num() + 1);
                simpleInterface.nothing();
                dismiss();
            }
        });
    }
}
